const Utils = {}
/*
 *防抖 将多次执行放到最后时间执行
 *@param {function} fn
 *@param {Number} delay
 */
Utils._debounce = function (fn, delay) {
  let timer = null
  return function () {
    if (timer) {
      clearTimeout(timer)
    }
    timer = setTimeout(() => {
      fn.apply(this, arguments)
      timer = null
    }, delay)
  }
}

export default Utils
